﻿using System;
using VDS.RDF;
using VDS.RDF.Parsing;

namespace Infrastructure.Helpers
{
   public static class NodeHelper
   {
      public static INode CreateDateTimeNode(Graph graph, DateTime dateTime)
      {
         return graph.CreateLiteralNode(dateTime.ToString(XmlSpecsHelper.XmlSchemaDateTimeFormat),
               new Uri(XmlSpecsHelper.XmlSchemaDataTypeDateTime));
      }

      public static INode CreateDateTimeOffsetNode(Graph graph, DateTimeOffset dateTimeOffset)
      {
         return graph.CreateLiteralNode(dateTimeOffset.ToString(XmlSpecsHelper.XmlSchemaDateTimeFormat),
      new Uri(XmlSpecsHelper.XmlSchemaDataTypeDateTime));
      }
   }
}
